﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ORMAC.CodeGen
{
    internal class NamingConventions
    {
        internal static string GetRightTablePropertyName(string rightTableName, string leftTableColumnName)
        {

            return rightTableName + "s";
        }
        internal static string GetLeftTablePropertyName(string leftTableName, string rightTableColumnName)
        {
            string relationName = rightTableColumnName;
            string[] pre = Settings.Default.FKPreFixes.Split(';');
            string[] post = Settings.Default.FKPostFixes.Split(';');
            foreach (string s in pre)
            {
                relationName = relationName.Replace(s, "");
            }
            foreach (string s in post)
            {
                relationName = relationName.Replace(s, "");
            }
            return relationName;

        }
    }
}
